import java.util.Scanner;

public class HomeWork10_03{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        Transportation trans;
        
        System.out.print("选择载具:\n"+
                         "1. 汽车\n"+
                         "2. 火车\n"+
                         "3. 飞机\n"+
                         "4. 轮船\n"+
                         "5. 自行车\n");
        int choose = scan.nextInt();
        switch(choose){
            case 1: trans = new Car(); break;
            case 2: trans = new Train(); break;
            case 3: trans = new Plane(); break;
            case 4: trans = new Ship(); break;
            case 5: trans = new Bike(); break;
            default: trans = new Leg(); break;
        }
        
        trans.run();
    }
}

interface Transportation{
    public abstract void run();
}

class Car implements Transportation{
    private String name = "汽车";
    public void run(){
        System.out.print(name + "在公路上行驶.");
    }
}

class Train implements Transportation{
    private String name = "火车";
    public void run(){
        System.out.print(name + "在铁轨上行驶.");
    }
}

class Plane implements Transportation{
    private String name = "飞机";
    public void run(){
        System.out.print(name + "在空中飞行.");
    }
}

class Ship implements Transportation{
    private String name = "轮船";
    public void run(){
        System.out.print(name + "在水中行驶");
    }
}

class Bike implements Transportation{
    private String name = "自行车";
    public void run(){
        System.out.print(name + "在路上缓慢的形势");
    }
}

class Leg implements Transportation{
    private String name = "腿";
    public void run(){
        System.out.print("你载着你的" + name + "在夕阳下奔跑");
    }
}